extends Node


@export var ZD:PackedScene

func _process(delta: float) -> void:
	
	var position = $Play.position
	
	if Input.is_action_pressed("left"):
		position.x -= 10
		$Play.go_left()
	if Input.is_action_pressed("right"):
		position.x += 10
		$Play.go_right()
	if Input.is_action_pressed("ui_up"):
		position.y -= 10
		$Play.go_up()
	if Input.is_action_pressed("ui_down"):
		position.y += 10
		$Play.go_down()
	#print("当前位置" , position,"当前地图的坐标",$Map.position)
	$Play.position = position
	
	
	


func _on_play_kh(jd: float) -> void:
	#print("准备开始创建子弹")
	var _ZD = ZD.instantiate()
	_ZD.position = $Play.position
	_ZD.YD(jd)
	add_child(_ZD)
